<?php

namespace App\Library\Rms;

use Illuminate\Support\Facades\Cache;

class RmsSysApi extends RmsBaseApi
{
    /**
     * 职位配置
     * @return array
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function sendRobotMessage(string $message, string $receiveId)
    {
        $param = [
            'message'   => $message,
            'receiveId' => $receiveId,
        ];

        return $this->rmsCurl->do('api/internal/robot/sendChatMessage', $param, 'POST');
    }

    /**
     * 查询tiger表最大id
     * @param string $table
     * @return array
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function getTableMaxId(string $table)
    {
        $params = [
            'table' => $table,
        ];

        return $this->rmsCurl->setDomain('https://api.51kuafu.com/tiger')->do('internal/common/getMaxId', $params, 'GET');
    }
}
